﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ChartSharp
{
    public enum PieChartType
    {
        TwoDimensional,
        ThreeDimensional,
    }

    public class PieChart : Chart
    {
        protected PieLabels _labels;

        public PieChart(PieChartType type)
            : base(GetPieChartType(type))
        {
        }

        public PieChart(PieChartType type, int width, int height)
            : base(GetPieChartType(type), new Size(width, height))
        {
        }

        public PieChart(PieChartType type, Size size)
            : base(GetPieChartType(type), size)
        {
        }

        public PieChart(PieChartType type, Size size, DataSets data)
            : base(GetPieChartType(type), size, data)
        {
        }

        public PieChart Labels(string[] labels)
        {
            _labels = new PieLabels(labels);
            return this;
        }

        public PieChart Labels(PieLabels labels)
        {
            _labels = labels;
            return this;
        }

        private static Type GetPieChartType(PieChartType type)
        {
            switch (type)
            {
		        case PieChartType.TwoDimensional:
                    return new Type("p");

                case PieChartType.ThreeDimensional:
                    return new Type("p3");
            }

            throw new ArgumentOutOfRangeException("type");
        }
    }
}
